#include "tcpServer.hpp"
#include <memory>
using namespace server;

static void Usage(char* proc)
{
    cout<<"/n/t"<<proc<<" local port error"<<endl;
}

//输入的形式为 ./tcpServer 8080的格式
int main(int argc,char* argv[])
{
    if(argc!=2)
    {
        Usage(argv[0]);
        exit(-1);
    }
    unique_ptr<tcpserver> tser(new tcpserver(atoi(argv[1])));  //智能指针
    tser->initServer();  //初始化操作
    tser->runServer();  //启动服务端

    return 0;
}